import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/layout'
Vue.use(Router)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [
    {
      path: '/dashboard',
      name: 'dashboard',
      component: () => import('@/views/dashborad'),
    },
    {
      //路由地址 测试
      path: "/list",
      name: 'list',
      component: () => import("@/views/list")
    }, {
      path: '/hotel',
      name: 'hotel',
      component: () => import("@/views/hotel")
    }, {
      path: '/property',
      name:'property',
      component: () => import("@/views/property")
    },
    {
      path: '/air',
      name:'air',
      component: () => import("@/views/air")
    },
    {
      path: '/borker',
      name:'borker',
      component: () => import("@/views/borker")
    }
    ]
  },
]
let router = new Router({
  routes,
})

// 解决路由跳转自己报错问题
const routerPath = Router.prototype.push
Router.prototype.push = function push (location) {
  return routerPath.call(this, location).catch(e => e)
}


export default router
